package com.google.gwt.sample.dynatablerf.client.widgets;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.sample.dynatablerf.client.events.GrifoSuggestEvent;
import com.google.gwt.user.client.ui.SuggestOracle;

public class GrifoSuggestOracle extends SuggestOracle implements
		HasGrifoSuggestHandler {

	private EventBus eventBus;

	public GrifoSuggestOracle() {
		super();
		this.eventBus = new SimpleEventBus();
	}

	@Override
	public void requestSuggestions(Request request, Callback callback) {
		eventBus.fireEvent(new GrifoSuggestEvent(request, callback));

	}

	public EventBus getEventBus() {
		return eventBus;
	}
}
